package com.qf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * User: key
 * ClassName:PageController
 * Date: 2023/5/25
 * Time: 19:55
 * description:
 */
@Controller
public class PageController {
    @RequestMapping("/")
    public String index() {
        return "index";
    }

    @RequestMapping("/{page}.html")
    public String toPage(@PathVariable String page) {
        System.out.println("page = " + page);
        return page;
    }

    @RequestMapping("/{path}/{page}.html")
    public String toPage2(@PathVariable String path, @PathVariable String page) {
        System.out.println("path = " + path + ", page = " + page);
        return path + "/" + page;
    }
}
